﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adm/Admin.Master" AutoEventWireup="true" CodeBehind="Posting.aspx.cs" Inherits="InstituteManager.adm.Posting" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">



	<h3>Posting</h3>
	
    <asp:Panel ID="pnlMessage" runat="server" CssClass="informasi" Visible="False">
        <asp:Label ID="lblMessage" runat="server" Text="Message"></asp:Label>
    </asp:Panel>


    <asp:Panel ID="pnlView" runat="server" CssClass="clssdiv">
    <div class="control">
        <asp:LinkButton ID="lbtAddnewT" runat="server" CssClass="add" 
            onclick="lbtAddnew_Click">Add New</asp:LinkButton>
        |<asp:LinkButton ID="lbtDeleteT" runat="server" CssClass="delete" 
            onclick="lbtDelete_Click">Delete</asp:LinkButton>
        |<asp:LinkButton ID="lbtRefreshT" runat="server" CssClass="refresh" 
            onclick="lbtRefresh_Click">Refresh</asp:LinkButton>
        |<a href="javascript:history.back();" id="lbtBackTV" Class="back" 
            >Go Back</a>
    </div>
    
    <div style="margin-left:5%;margin-top:20px;">
            <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
            <asp:ImageButton ID="ibtSearch" runat="server" CssClass="search"
                ImageUrl="~/images/icons/google_custom_search.png" ToolTip="Search" 
                onclick="ibtSearch_Click" />
        </div>
    
        <asp:GridView ID="grvView" runat="server" CssClass="data" 
            AutoGenerateColumns="False" EnableModelValidation="True" 
            onrowdatabound="grvView_RowDataBound" AllowPaging="True" 
            onpageindexchanging="grvView_PageIndexChanging" 
            onrowcommand="grvView_RowCommand" DataKeyNames="PostingId">
                <Columns>
                    <asp:TemplateField>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="chkSelectAll" runat="server" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkSelect" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="PostingId" HeaderText="PostingId" 
                        Visible="False" />
                    <asp:BoundField DataField="PostingName" HeaderText="Posting Name" />
                    <asp:BoundField DataField="PostDate" HeaderText="Post Date" 
                        DataFormatString="{0:d}" />
                    <asp:BoundField DataField="Price" HeaderText="Price" />
                    <asp:TemplateField HeaderText="Competition Joined">
                       
                        <ItemTemplate>
                            <asp:Label ID="lblCompetitionView" runat="server" Text='<%# getCompetitionName(DataBinder.Eval (Container.DataItem, "PostingId").ToString()) %>'></asp:Label>                            
                            <asp:Image ID="imgComRunning" runat="server" 
                                ImageUrl="~/images/icons/clock.png" ToolTip="Running" Visible='<%# (! IsCompetitionExpired(DataBinder.Eval (Container.DataItem, "PostingId").ToString())) %>' />
                            <asp:Image ID="imgComFinish" runat="server" 
                                ImageUrl="~/images/icons/clock_red.png" ToolTip="Finish" Visible='<%# (IsCompetitionExpired(DataBinder.Eval (Container.DataItem, "PostingId").ToString())) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Mark">
                        
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# getMarkString(DataBinder.Eval (Container.DataItem, "Mark")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Command">
                        <ItemTemplate>
                            <asp:ImageButton ID="ibtEdit" runat="server" CommandName="cmdEdit" 
                                ImageUrl="~/images/icons/pencil.png" ToolTip="Edit" CommandArgument='<%# DataBinder.Eval (Container.DataItem, "PostingId") %>' />
                            <asp:ImageButton ID="ibtDelete" runat="server" CommandName="cmdDelete" CommandArgument='<%# DataBinder.Eval (Container.DataItem, "PostingId") %>'
                                ImageUrl="~/images/icons/cross.png" ToolTip="Delete" OnClientClick="javascript:return confirm('Are you sure ? ')" />
                            <asp:ImageButton ID="ibtView" runat="server" AlternateText="View" CommandArgument='<%# DataBinder.Eval (Container.DataItem, "PostingId") %>'
                                CommandName="cmdView" ImageUrl="~/images/icons/eye.png" ToolTip="View" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="data" />
                <PagerSettings Mode="NumericFirstLast" PageButtonCount="5" />
                <PagerStyle HorizontalAlign="Center" Wrap="True" />
                <RowStyle CssClass="data" />
            </asp:GridView>

                

      <div class="control">
        <asp:LinkButton ID="lbtAddnewB" runat="server" CssClass="add" onclick="lbtAddnew_Click">Add New</asp:LinkButton>
        |<asp:LinkButton ID="lbtDeleteB" runat="server" CssClass="delete" onclick="lbtDelete_Click">Delete</asp:LinkButton>
        |<asp:LinkButton ID="lbtRefreshB" runat="server" CssClass="refresh" onclick="lbtRefresh_Click">Refresh</asp:LinkButton>
        |<a href="javascript:history.back();" ID="lbtBackB" Class="back">Go Back</a>
    </div>
    </asp:Panel>
    
   
    <asp:Panel ID="pnlUpdate" runat="server" Visible="False">
        <div class="control">
            <asp:LinkButton ID="lbtSaveT" runat="server" CssClass="save" onclick="lbtSave_Click">Save</asp:LinkButton>
            |<asp:LinkButton ID="lbtBackUT" runat="server" CssClass="back" OnClick="lbtBack_Click" CausesValidation="False">Go Back</asp:LinkButton>

        </div>

        <asp:TextBox ID="txtId" runat="server" Visible="False"></asp:TextBox>
        
		    <table width="95%" class="update">
			    <tr><td width="125px"><b>Posting Name</b></td><td> 
                    <asp:TextBox ID="txtPostingName" runat="server" Width="40%"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvPostingName" runat="server" 
                        ControlToValidate="txtPostingName" 
                        ErrorMessage="You must enter Posting Name !" Font-Bold="True"></asp:RequiredFieldValidator>
                    </td></tr>			    
                <tr><td><b>Description</b></td><td>
                    <asp:TextBox ID="txtDescription" runat="server" Width="80%" 
                        TextMode="MultiLine"></asp:TextBox>                    
                    </td></tr>
			    <tr><td><b>Price</b></td><td>
                    <asp:TextBox ID="txtPrice" runat="server" Width="40%"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="revPrice" runat="server" 
                        ControlToValidate="txtPrice" ErrorMessage="Price must is number only !" 
                        Font-Bold="True" ValidationExpression="(\d)*"></asp:RegularExpressionValidator>
                    </td></tr>
                
                 <tr><td ><b>Image Url</b></td><td>
                     <asp:FileUpload ID="fudImageURL" runat="server" />

                    </td></tr>
			    <tr><td><b>Competition Joined</b></td>
                    <td>
                        <asp:DropDownList ID="ddlCompetitionId" runat="server">
                            <asp:ListItem Value="0">Choice Competition</asp:ListItem>
                        </asp:DropDownList>
                        </td>
                </tr>
			    </table>

            
        <div class="control">
            <asp:LinkButton ID="lbtSaveB" runat="server" CssClass="save" 
                onclick="lbtSave_Click">Save</asp:LinkButton>
            |<asp:LinkButton ID="lbtBackUB" runat="server" CssClass="back" OnClick="lbtBack_Click" CausesValidation="False">Go Back</asp:LinkButton>
        </div>
    </asp:Panel>

   <asp:Panel ID="pnlDetail" runat="server" Visible="False">
        <div class="control">
            <asp:LinkButton ID="lbtBackDetailT" runat="server" CssClass="back"  
                CausesValidation="False" onclick="lbtBackDetail_Click">Go Back</asp:LinkButton>

        </div>
                

		    <table width="95%" class="data">
            <tr><th>Data Name</th><th>&nbsp;Data</th></tr>

			    <tr><td width="125px"><b>Posting Name</b></td><td> 
                    <asp:Label ID="lblPostingName" runat="server" Text=""></asp:Label>
                    </td></tr>
			    <tr><td><b>Post Date</b></td><td>
                    <asp:Label ID="lblPostDate" runat="server" Text=""></asp:Label>
                    </td></tr>
                <tr><td><b>Description</b></td><td>
                    <asp:Label ID="lblDescription" runat="server" Text=""></asp:Label>
                    </td></tr>
			    <tr><td><b>Price</b></td><td>
                    <asp:Label ID="lblPrice" runat="server" Text=""></asp:Label>
                    </td></tr>
                <tr><td><b>Competition Joined</b></td><td>
                    <asp:Label ID="lblCompetitionName" runat="server" Text=""></asp:Label>
                    </td></tr>
                 <tr><td ><b>Mark</b></td><td>
                     <asp:Label ID="lblMark" runat="server" Text=""></asp:Label>
                    </td></tr>
                <tr><td ><b>Remark</b></td><td>
                     <asp:Label ID="lblRemark" runat="server" Text=""></asp:Label>
                    </td></tr>
                <tr><td ><b>Image</b></td><td>
                    <asp:Image ID="imgImage" runat="server" ImageUrl="~/images/icons/eye.png" 
                         />
                    </td></tr>
			    </table>

        <div class="control">
            <asp:LinkButton ID="lbtBackDetailB" runat="server" CssClass="back" OnClick="lbtBackDetail_Click" CausesValidation="False">Go Back</asp:LinkButton>
        </div>
    </asp:Panel>


</asp:Content>
